package isAnagram;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class Solution {
    public boolean isAnagram(String s, String t) {
        //
        if(s.length()!=t.length()) return false;
        int[] mask = new int[26];
        for (int i = 0; i < s.length(); i++) {
            mask[(s.charAt(i)-'a')]++;
            mask[(t.charAt(i)-'a')]--;
        }
        for (int c: mask) {
            if(c!=0) return false;
        }
        return true;
    }
}
